﻿#region Includes

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace ArtheaEngine.Model
{
    public partial class Help : IEquatable<Help>, IEntity
    {
        #region Implementation of IEquatable<Help>

        public override bool Equals(object obj)
        {
            if (!(obj is Help)) return false;

            return Equals(obj as Help);
        }

        public override int GetHashCode()
        {
            return Id.GetHashCode();
        }

        /// <summary>
        ///                     Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.
        /// </returns>
        /// <param name="other">
        ///                     An object to compare with this object.
        ///                 </param>
        public bool Equals(Help other)
        {
            return Id == other.Id;
        }

        #endregion

        public string TagCSV()
        {
            var buf = new StringBuilder();

            foreach (var tag in Tags)
            {
                buf.Append(tag.Tag).Append(", ");
            }
            if (buf.Length > 1)
                buf.Remove(0, 2);

            return buf.ToString();
        }
    }

    public struct HelpCategory
    {
        public static readonly Flag None = 0;
        public static readonly Flag Admin = Flag.MakeBit(0);
        public static readonly Flag Information = Flag.MakeBit(1);

    }
}